﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using WebApiOrm.Domain;

namespace WebApiOrm.Provider
{
    /// <summary>
    /// Orm提供者接口
    /// </summary>
    public interface IOrmProvider
    {
        /// <summary>
        /// 获取Orm版本
        /// </summary>
        Version? Version { get; }

        /// <summary>
        /// 添加SysUser
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        Task<bool> AddSysUserAsync(SysUser user);

        /// <summary>
        /// 使用Id排序
        /// 查询SysUser
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <param name="skip">起始索引</param>
        /// <param name="take">取多少条</param>
        /// <returns></returns>
        Task<IList<SysUser>> QuerySysUsersAsync(Expression<Func<SysUser, bool>> predicate, int skip, int take);
    }
}